package com.credithc.signature.common.mapper;

import com.credithc.baseserv.core.mapper.BsBaseMapper;
import com.credithc.signature.common.po.SignatureLog;
import com.credithc.signature.common.ro.manager.JobRequestRo;
import com.credithc.signature.common.ro.manager.RequestLogRo;
import com.credithc.signature.common.vo.manager.SignLogPreviewVo;
import com.credithc.signature.common.vo.manager.SignLogVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface SignatureLogMapper extends BsBaseMapper<SignatureLog> {

    int updateByReqSNSelective(@Param("signatureLog") SignatureLog signatureLog);

    List<SignLogVo> selectAllSelective(@Param("requestSN") String requestSN, @Param("templateNo") String templateNo,
                                       @Param("channelNoList") List<String> channelNoList, @Param("signStatus") Integer signStatusList,
                                       @Param("needSeal") Integer needSeal, @Param("startTime") Date startTime,
                                       @Param("endTime") Date endTime, @Param("templateName") String templateName,
                                       @Param("sealType") Integer sealType, @Param("pageStart") Integer pageStart,
                                       @Param("pageSize") Integer pageSize,@Param("code") String code);

    int selectAllCountSelective(@Param("requestSN") String requestSN, @Param("templateNo") String templateNo,
                                @Param("channelNoList") List<String> channelNoList, @Param("signStatus") Integer signStatusList,
                                @Param("needSeal") Integer needSeal, @Param("startTime") Date startTime,
                                @Param("endTime") Date endTime, @Param("templateName") String templateName,
                                @Param("sealType") Integer sealType,@Param("code") String code);

    /**
     * 签章记录分页查询--list
     *
     * @param requestLogRo
     * @return
     */
    List<SignatureLog> querySignatureLogList(@Param("condition") RequestLogRo requestLogRo);

    /**
     * 签章记录分页查询--count
     *
     * @param requestLogRo
     * @return
     */
    int querySignatureLogListCount(@Param("condition") RequestLogRo requestLogRo);

    SignLogPreviewVo selectSignLogPreviewVo(@Param("id") Long id,@Param("createTime")Date createTime,@Param("startTime")Date startTime);

    List<SignatureLog> selectJobInfos(@Param("condition") JobRequestRo jobRequestRo);

    int selectJobInfosCount(@Param("condition") JobRequestRo jobRequestRo);
}
